<?php
	class Product_images_model extends CI_Model {
	    
    var $id;
	var $image;    
	var $product_id;
	var $order;
	var $active;
	var $date_created;

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

    public function info($con)
    {
    	$this->db->select('*');
  
    	if(!empty($con['id']))
    	{
    		$this->db->where('id', $con['id']);
    	}

    	$query = $this->db->get('product_images');
    	return $query->row();
    }

    public function infos($con)
    {
    	$this->db->select('*');
  
    	if(!empty($con['product_id']))
    	{
    		$this->db->where('product_id', $con['product_id']);
    	}

    	$query = $this->db->get('product_images');
    	return $query->result();
    }

    public function insert($data)
    {
    	return $this->db->insert('product_images', $data);
    }	

    public function delete($id)
    {
    	$this->db->where('id',$id);
    	return $this->db->delete('product_images');
    }
}